package com.example.yunJie.digitalSentry.mapper.one;


import com.example.yunJie.digitalSentry.entity.MarketPostEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.io.Serializable;
import java.util.List;

public interface MarketPostMapper {
//    @Insert("<script>insert into sz_market(marketId,postId)\n" +
//            "        values(#{marketId},#{postId})</script>")
    int insert(MarketPostEntity marketPostEntity);

//    @Update("<script>update sz_market\n" +
//            "        <trim prefix=\"SET\" suffixOverrides=\",\">\n" +
//            "            <if test=\"marketId != null\">marketId = #{marketId},</if>\n" +
//            "            <if test=\"postId != null\">postId = #{postId},</if>\n" +
//            "        </trim>\n" +
//            "        where id = #{id}</script>")
    int update(MarketPostEntity marketPostEntity);

//    @Delete("<script>delete from sz_market where id = #{Id}</script>")
    int deleteById(String id);

//    @Delete("<script>delete from sz_market where id in\n" +
//            "        <foreach collection=\"array\" item=\"id\" open=\"(\" separator=\",\" close=\")\">\n" +
//            "            #{id}\n" +
//            "        </foreach></script>")
    int deleteIdList(List<Integer> idList);

//    @Select("<script>select  marketId,postId\n" +
//            "        from sz_market\n" +
//            "        where id = #{id}</script>")
    MarketPostEntity findId(Serializable id);

//    @Select("<script>select * from sz_market</script>")
    List<MarketPostEntity> findAll(MarketPostEntity marketPostEntity);

    MarketPostEntity find(String marketId,String postId);

}
